package standalone;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;


import corpus.Word;
import corpus.WordNet;

public class GenerateAdjList {

	public static void main(String[] args) throws IOException {
		new GenerateAdjList("C:\\Program Files (x86)\\WordNet\\2.1");
	}

	private WordNet dict;

	public GenerateAdjList(String wordNetHome) throws IOException {
		System.out.println("Loading WordNet");
		File output = new File("adjectives.txt");
		BufferedWriter bw = new BufferedWriter(new FileWriter(output));
		dict = new WordNet(wordNetHome);

		System.out.println(dict.words().size());
		for (Word w : dict.words())
			if (w.getPos().equals("ADJECTIVE")) {
				String word = w.getWord();
				word = word.replaceAll("[^A-Za-z]", "");
				bw.append(word + "\n");
			}
	}
}
